$(function () {
    queryAjaxGiftCardCode(1);
    $('body').on('click','#submitGiftCardCode',function () {
        queryAjaxGiftCardCode(1);
    });
    $('body').on('click','#back',function () {
        backHistory();
    }).on('click','#downloadExcel',function(){
            exportExecl.init({
                    title:"礼品卡导出",
                    excelUrl: '/admin/op/giftCard/downloadExcelGiftCardList',
                    type:5,
                    valId:$('input[name="giftCardId"]').val()
                }
            )
    });

});
/**
 * 返回上一页
 */
function backHistory() {
    window.history.go(-1);
}
function queryAjaxGiftCardCode(pageNo) {
    var params = $("#search-form").serializeJSON();
    params = JSON.stringify(params);
    var obj = {
        url: baseloaction + '/admin/op/giftCard/queryOpGiftCardCodeListPage',//请求URL
        contextId: 'giftCardCode-list-context',//响应内容页面设置内容ID
        params: params,//请求参数
        pageNo: pageNo,//页码
        pageCall: queryAjaxGiftCardCode, //分页回调加载数据(点击上下页时调用,该方法也在加载页面完成时调用)
        selectAllId: 'select-all-giftCardCode', //全选框ID
        callback: function () {//数据加载完成回调
            $("#totalNum").html("（共"+total+"个推荐位置）");
        }
    };
    ajaxGetListData(obj);
}